package com.yc.service;

import cn.dev33.satoken.stp.StpInterface;
import com.yc.domain.LoginUserDto;
import com.yc.helper.LoginHelper;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        LoginUserDto loginUserDto = LoginHelper.getLoginUser();
        if (null != loginUserDto) {
            return loginUserDto.getPermissionList();
        }
        // 超级管理员
        return new ArrayList<>();
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return null;
    }
}
